import request from '@/utils/request'

// 安评等级列表
export function safetyRatingList(query) {
    return request({
      url: '/test/dictItems/getDictItemByDictId/dzqhapdj',
      method: 'get',
      params: query
    })
  }

  // 所在行政区列表
export function xzqList(query) {
  return request({
    url: '/fxfz/sArea/jsonSAreaTree',
    method: 'get',
    params: query
  })
}

//工程类别列表
export function projectTypeList(query) {
  return request({
    url: '/test/dictItems/getDictItemByDictId/dzqhgclb',
    method: 'get',
    params: query
  })
}

//钻孔依托的项目
export function queryAllProject(query) {
  return request({
    url: '/saResults/queryAllProject',
    method: 'get',
    params: query
  })
}

// 项目表格查询
export function getSaResultsProject(query) {
  return request({
    url: '/saResults/getSaResultsProject',
    method: 'get',
    params: query
  })
}


// 孔位表格查询
export function getSaResultsHl(query) {
  return request({
    url: '/saResults/getSaResultsHl',
    method: 'get',
    params: query
  })
}

//项目信息删除
export function deleteSaResultsProject(query) {
  return request({
      url: '/saResults/deleteSaResultsProject',
      method: 'get',
      params: query
  })
}

//项目信息修改 提交等
export function saveOrUpdateSaResults(data) {
  return request({
      url: '/saResults/saveOrUpdate',
      method: 'post',
      data: data
  })
}


//导出表内数据
export function exportExcelSaResults(query) {
  return request({
      url: '/saResults/exportExcelSaResults',
      method: 'get',
      params: query
  })
}

//导入数据
export function importExcelSaResults(data) {
  return request({
      url: '/saResults/importExcelSaResults',
      method: 'post',
      data: data
  })
}

// 修改 删除回显， 查看 
export function getSaResultsById(query) {
  return request({
    url: '/saResults/getSaResultsById',
    method: 'get',
    params: query
  })
}


// 查询用户未提交数据 
export function notSubmitted(query) {
  return request({
    url: '/saResults/notSubmitted',
    method: 'get',
    params: query
  })
}

// 历史记录查询
export function queryHistory(query) {
  return request({
    url: '/saResults/getHistory',
    method: 'get',
    params: query
  })
}

// 查询用户是否是管理员，即角色
export function queryUserRole(query) {
  return request({
    url: '/saResults/queryUserRole',
    method: 'get',
    params: query
  })
}


// 下载附件
export function downLoadFile(query) {
  return request({
    url: '/attachment/downLoadFile',
    method: 'get',
    params: query
  })
}

//删除附件
export function deleteFile(data) {
  return request({
      url: '/attachment/deleteFile',
      method: 'post',
      data: data
  })
}

// 审批
export function reviewComment(data) {
  return request({
      url: '/saResults/approve',
      method: 'post',
      data: data
  })
}
// 修改意见
export function reasonUpdate(data) {
  return request({
      url: '/saResults/adminUpdate',
      method: 'post',
      data: data
  })
}

// 删除原由
export function reasonDelete(data) {
  return request({
      url: '/saResults/deleteById',
      method: 'post',
      data: data
  })
}

//zyt修改start
//上传Shp文件
export function uploadShpFile(data) {
    return request({
        url: '/saResultsMap/uploadShpFile',
        method: 'post',
        data: data
    })
}

//安评成果目录根据经纬度获取geomText值
export function getGeomTextByLonLatString(data) {
    return request({
        url: '/saResultsMap/getGeomTextByLonLatString',
        method: 'post',
        data: data
    })
}

//安评成果目录项目信息地图圈选查询
export function querySaResultsProjectByGeomText(query) {
    return request({
        url: '/saResultsMap/querySaResultsProjectByGeomText',
        method: 'get',
        params: query
    })
}

//安评成果目录孔位信息地图圈选查询
export function querySaResultsHlByGeomText(query) {
    return request({
        url: '/saResultsMap/querySaResultsHlByGeomText',
        method: 'get',
        params: query
    })
}
//zyt修改end









// const onSearch = () => {
//   console.log("search!");
//   const tempParams = params.value;
//   getSaResultsProject(tempParams).then(res => {
//     console.log(res)
//   }).catch(err => {
//     console.log(err)
//   })
// };
